home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 163 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.1 KB  |  31 lines

  1. Newsgroups: comp.lang.c
  2. Path: netcom.com!brianr
  3. From: brianr@netcom.com (Brian Rankin)
  4. Subject: How to bind to an IP address?
  5. Message-ID: <brianrDKKLA1.2J2@netcom.com>
  6. Keywords: IP address bind Unix port
  7. Organization: Overseas Unix Support
  8. X-Newsreader: TIN [version 1.2 PL1]
  9. Date: Tue, 2 Jan 1996 20:08:25 GMT
  10. Sender: brianr@netcom22.netcom.com
  11.  
  12. My Sparc-Solaris2.4 box has two IP addresses - it's "real" address (assigned
  13. during installation) and an additional "secondary" IP address.  Multiple IP
  14. addresses were needed for another purpose; the machine can be accessed from
  15. the Internet via either IP address.  The secondary address is a vaild IP 
  16. address that the NIC understands.
  17.  
  18. For you Solaris folks, all I'm do is this command:
  19. ifconfig le0:1 198.49.xxx.x up
  20.  
  21. OK:
  22. I need to write a C program that listens to port 8001 on the "secondary"
  23. address.  I've written the program and it works fine, but it's listening
  24. to the "real" IP address...how do I tell the program to listen to
  25. the secondary IP address?  Any information gratefully appreciated.
  26.  
  27. Sincerely,
  28.  
  29. Brian Rankin
  30.  
  31.